<template>
	<view>
		<view class="h1">{{detail.title}}</view>
		<video id="myVideo" :src="detail.url" :poster='detail.cover' enable-danmu controls></video>
		<view class="contentBox">
			<uParse :content="content" @preview="preview" @navigate="navigate" />
		</view>
	</view>
</template>

<script>
	import uParse from '@/components/uParse/src/wxParse.vue'
	export default {
		components: {
			uParse
		},
		
		data() {
			return {
				id:'',
				content:'',
				detail:'',
				myVideo:''
			};
		},
		onLoad(data) {
			this.id = data.data;
			this.keVideodetail();
		},
		methods: {
			keVideodetail(){
				var _this = this
				uni.request({
					url:this.$API.keVideodetail,
					method:"GET",
					data:{
						userid:uni.getStorageSync("userid"),
						id:this.id,
					},
					header:this.$API.get_head(),
					success: (res) => {
						_this.detail = res.data.data;
						_this.content = res.data.data.content;
						//isLink 如果isLink=0或者为空时。就是服务器内部地址
					},
					fail: () => {
						uni.showToast({
							title:"加载失败",
							icon:'none'
						})
					}
				})
			}
		}
	}
</script>

<style>
	video{
		margin:0 auto;
		display:block;
	}
	.h1{
		font-size:40upx;
		color:#333333;
		padding: 20upx;
		font-weight:bold;
	}
	.contentBox{
		padding:40upx;
	}
</style>
